package com.satan.fmmall.service.impl;

import com.satan.fmmall.mapper.CategoryMapper;
import com.satan.fmmall.service.CategoryService;
import com.satan.fmmall.vo.CategoryVo;
import com.satan.fmmall.vo.ResultVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName CategoryServiceImpl
 * @Description TODO
 * @date 2022/4/5 14:08
 * @Version 1.0
 */
@Service
public class CategoryServiceImpl implements CategoryService {
    @Resource
    private CategoryMapper categoryMapper;
    @Override
    public ResultVo listCategories() {
        List<CategoryVo> categoryVos = categoryMapper.selectAllCategories2(0);
        return ResultVo.success(categoryVos);
    }

    @Override
    public ResultVo listFirstLevelCategories() {
        List<CategoryVo> categoryVos = categoryMapper.selectFirstLevelCategories();
        return ResultVo.success(categoryVos);

    }
}
